<?php $this->pageTitle=Yii::app()->name . ' - '.UserModule::t("Registration");
$this->breadcrumbs=array(
	UserModule::t("Registration"),
);
?>

<div class="register"><h1><?php echo UserModule::t("Đăng kí làm đơn vị vận chuyển"); ?></h1>
    
    <?php if(Yii::app()->user->hasFlash('registration')): ?>
    <div class="success">
    <?php echo Yii::app()->user->getFlash('registration'); ?>
    </div>
    <?php else: ?>
    
    <div class="form">
    <?php $form=$this->beginWidget('UActiveForm', array(
        'id'=>'registration-form',
        'enableAjaxValidation'=>true,
        'disableAjaxValidationAttributes'=>array('RegistrationForm_verifyCode'),
        'htmlOptions' => array('enctype'=>'multipart/form-data'),
    )); ?>
    
        <p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>
        
        <?php // echo $form->errorSummary(array($model)); ?>
        <div class="row">
            <label for="RegistrationForm_full_name" class="required"><?php echo 'Tên công ty'; ?><span class="required">*</span></label>
        
        <?php echo CHtml::activeTextArea($model,'full_name',array('class'=>'full-name')); ?>
        <?php echo $form->error($model,'full_name'); ?>
        </div>
            <div class="row">
            <?php echo CHtml::activeLabelEx($model,'method_tran'); ?>
            <?php echo CHtml::activeDropDownList($model,'method_tran',array('0'=>'Chọn loại hình vận chuyển','1'=>'Xe tải','2'=>'Máy bay')); ?>
            <?php echo CHtml::error($model,'method_tran'); ?>
        </div>
        <div class="row">
            <label for="RegistrationForm_username" class="required"><?php echo 'Tên đại diện '; ?> <span class="required">*</span></label>
        
        <?php echo $form->textField($model,'username'); ?>
        <?php echo $form->error($model,'username'); ?>
        </div>
        
        <div class="row">
        <?php echo $form->labelEx($model,'password'); ?>
        <?php echo $form->passwordField($model,'password'); ?>
        <?php echo $form->error($model,'password'); ?>
    <!--    <p class="hint">
        <?php // echo UserModule::t("Minimal password length 4 symbols."); ?>
        </p>-->
        </div>
        
        <div class="row">
        <?php echo $form->labelEx($model,'verifyPassword'); ?>
        <?php echo $form->passwordField($model,'verifyPassword'); ?>
        <?php echo $form->error($model,'verifyPassword'); ?>
        </div>
        
        <div class="row">
        <?php echo $form->labelEx($model,'email'); ?>
        <?php echo $form->textField($model,'email'); ?>
        <?php echo $form->error($model,'email'); ?>
        </div>
            
            
            <div class="row">
            <?php echo CHtml::activeLabelEx($model,'avatar'); ?>
            <?php echo CHtml::activeFileField($model,'avatar'); ?>
            <?php echo CHtml::error($model,'avatar'); ?>
        </div>        
    <!--    <div class="row">-->
            <?php // echo CHtml::activeLabelEx($model,'status'); ?>
            <?php // echo CHtml::activeDropDownList($model,'status',User::itemAlias('UserStatus')); ?>
            <?php // echo CHtml::error($model,'status'); ?>
    <!--    </div>-->
        <div class="row">
            <?php echo CHtml::activeLabelEx($model,'phone'); ?>
            <?php echo CHtml::activeTextField($model,'phone',array('size'=>45,'maxlength'=>45)); ?>
            <?php echo CHtml::error($model,'phone'); ?>
        </div>
    
        <div class="row">
            <?php echo CHtml::activeLabelEx($model,'mobile'); ?>
            <?php echo CHtml::activeTextField($model,'mobile',array('size'=>45,'maxlength'=>45)); ?>
            <?php echo CHtml::error($model,'mobile'); ?>
        </div>
            <div class="row">
            <?php echo CHtml::activeLabelEx($model,'province'); ?>
            <?php echo CHtml::activeDropDownList($model,'province',Yii::app()->getModule('user')->provinceArr); ?>
            <?php echo CHtml::error($model,'province'); ?>
        </div>
        <div class="row">
            <?php echo CHtml::activeLabelEx($model,'address'); ?>
            <?php echo CHtml::activeTextField($model,'address'); ?>
            <?php echo CHtml::error($model,'address'); ?>
        </div>
            <div class="row">
            <?php echo CHtml::activeLabelEx($model,'web'); ?>
            <?php echo CHtml::activeTextField($model,'web'); ?>
            <?php echo CHtml::error($model,'web'); ?>
        </div>
        
        <?php if (UserModule::doCaptcha('registration')): ?>
        <div class="row">
            <?php echo $form->labelEx($model,'verifyCode'); ?>
            
            <?php $this->widget('CCaptcha'); ?>
        </div>
        <div class="row">
            <label for="">&nbsp;</label>
            <?php echo $form->textField($model,'verifyCode'); ?>
            <?php echo $form->error($model,'verifyCode'); ?>
        </div>
        <?php endif; ?>
        
        <div class="row submit">
            <label for="">&nbsp;</label>
            <?php echo CHtml::submitButton(UserModule::t("Register")); ?>
        </div>
    
    <?php $this->endWidget(); ?>
    </div><!-- form -->
    <?php endif; ?></div>